package client.gui;

import java.util.ArrayList;

import javax.jmdns.ServiceEvent;
import javax.swing.JPanel;

import client.CheckinClient;
import client.Client;
import client.DutyFreeClient;
import client.Fclient;
import client.MusicClient;
import client.OfficeClient;
import client.Service;
import client.ServiceType;

public class DisplayPanel extends JPanel {
	private static final long serialVersionUID = 71475359396206967L;
	protected Client myClient; 
	private ServiceType type;
	public DisplayPanel(Service s){
		type = s.getType();
		switch (type) {
		case MusicServer:
			myClient = new MusicClient(s);
			break;
		case OfficeServices:
			myClient = new OfficeClient(s);
			break;
		case AutoCheckIn:
			myClient = new CheckinClient(s);
			break;
		case DutyFreeInfo:
			myClient = new DutyFreeClient(s);
			break;
		case ArrivalsInfo:
			myClient = new Fclient(s);
//			System.out.println("Starting client");
			break;
	} 

	}
	public ServiceType getType() {
		return type;
	}
	public void addService(Service newService) {
		myClient.addService(newService);
	}
	public boolean removeService(ServiceEvent newService) {
		myClient.removeService(newService);
		if(myClient.getServer() == null){
			return true;
		}
		return false;
	}
	
	

}
